package com.persondemo.videoappliction.ui.adapter;

import android.content.Context;
import android.support.annotation.Nullable;
import android.widget.RatingBar;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.lzy.ninegrid.ImageInfo;
import com.lzy.ninegrid.NineGridView;
import com.lzy.ninegrid.preview.NineGridViewClickAdapter;
import com.persondemo.videoappliction.R;
import com.persondemo.videoappliction.bean.DianPingBean;
import com.persondemo.videoappliction.utils.ImageLoaderUtil;

import java.util.List;
//评论列表
public class DianPingAdapter extends BaseQuickAdapter<DianPingBean.DataBean, BaseViewHolder> {
    private Context context;

    public DianPingAdapter( @Nullable List<DianPingBean.DataBean> data, Context context) {
        super(R.layout.item_dianping, data);
        this.context = context;
    }
    @Override
    protected void convert(BaseViewHolder helper, DianPingBean.DataBean item) {
        ImageLoaderUtil.LoadImage(context,item.getImgs(),helper.getView(R.id.dianping_img));
        helper.setText(R.id.dianping_title, item.getTitle());
        helper.setText(R.id.dianping_socre,item.getPing());
        RatingBar rb=helper.getView(R.id.dianping_Ratingbar);
        rb.setRating(Float.parseFloat(item.getPing()));
        helper.setText(R.id.dianping_price, "￥"+item.getPercapita()+"/人");
        helper.setText(R.id.dianping_location, item.getShangquan());
        helper.setText(R.id.dianping_distance, item.getJuli());

    }
}
